﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using nERP.Model;
using nERP.Model.Bas;
using nERP.Model.Po;
using nERP.Model.So;
using nERP.Model.Wms;
using nERP.Model.Fin;

namespace WalkingTec.Mvvm.Core
{
    /// <summary>
    /// 用户
    /// </summary>
	[Table("FrameworkUsers")]
    [SoftKey(nameof(FrameworkUser.ITCode))]
    [Display(Name = "_Model.FrameworkUser")]
    public class FrameworkUser : FrameworkUserBase
    {
        [Display(Name = "_Model._FrameworkUser._Email")]
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("邮箱")]
        [RegularExpression("^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$", ErrorMessage = "Validate.{0}formaterror")]
        public string Email { get; set; }
        [Display(Name = "_Model._FrameworkUser._Gender")]
        [Comment("性别")]
        public GenderEnum? Gender { get; set; }
        [Display(Name = "_Model._FrameworkUser._CellPhone")]
        [Comment("手机")]
        [RegularExpression("^[1][345789][0-9]{9}$", ErrorMessage = "Validate.{0}formaterror")]
        public string CellPhone { get; set; }
        [Display(Name = "_Model._FrameworkUser._HomePhone")]
        [StringLength(30, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("座机")]
        [RegularExpression("^[-0-9\\s]{8,30}$", ErrorMessage = "Validate.{0}formaterror")]
        public string HomePhone { get; set; }
        [Display(Name = "_Model._FrameworkUser._Address")]
        [StringLength(200, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("地址")]
        public string Address { get; set; }
        [Display(Name = "_Model._FrameworkUser._ZipCode")]
        [Comment("邮编")]
        [RegularExpression("^[0-9]{6,6}$", ErrorMessage = "Validate.{0}formaterror")]
        public string ZipCode { get; set; }
        [Display(Name = "_Model._Warehouse._ChargePerson")]
        [InverseProperty("ChargePerson")]
        [NotMapped]
        [SoftFK(nameof(nERP.Model.Bas.Warehouse.ChargePersonId))]
        public List<Warehouse> Warehouse_ChargePerson { get; set; }
        [Display(Name = "_Model._Buy._MakeUser")]
        [InverseProperty("MakeUser")]
        [NotMapped]
        [SoftFK(nameof(nERP.Model.Po.Buy.MakeUserId))]
        public List<Buy> Buy_MakeUser { get; set; }
        [Display(Name = "_Model._BuyReturn._MakeUser")]
        [InverseProperty("MakeUser")]
        [NotMapped]
        [SoftFK(nameof(nERP.Model.Po.BuyReturn.MakeUserId))]
        public List<BuyReturn> BuyReturn_MakeUser { get; set; }
        [Display(Name = "_Model._Sale._MakeUser")]
        [InverseProperty("MakeUser")]
        [NotMapped]
        [SoftFK(nameof(nERP.Model.So.Sale.MakeUserId))]
        public List<Sale> Sale_MakeUser { get; set; }
        [Display(Name = "_Model._SaleReturn._MakeUser")]
        [InverseProperty("MakeUser")]
        [NotMapped]
        [SoftFK(nameof(nERP.Model.So.SaleReturn.MakeUserId))]
        public List<SaleReturn> SaleReturn_MakeUser { get; set; }
        [Display(Name = "_Model._SaleOutWarehouse._MakeUser")]
        [InverseProperty("MakeUser")]
        [NotMapped]
        [SoftFK(nameof(nERP.Model.Wms.SaleOutWarehouse.MakeUserId))]
        public List<SaleOutWarehouse> SaleOutWarehouse_MakeUser { get; set; }
        [Display(Name = "_Model._SaleReturnInWarehouse._MakeUser")]
        [InverseProperty("MakeUser")]
        [NotMapped]
        [SoftFK(nameof(nERP.Model.Wms.SaleReturnInWarehouse.MakeUserId))]
        public List<SaleReturnInWarehouse> SaleReturnInWarehouse_MakeUser { get; set; }
        [Display(Name = "_Model._OtherInWarehouse._MakeUser")]
        [InverseProperty("MakeUser")]
        [NotMapped]
        [SoftFK(nameof(nERP.Model.Wms.OtherInWarehouse.MakeUserId))]
        public List<OtherInWarehouse> OtherInWarehouse_MakeUser { get; set; }
        [Display(Name = "_Model._OtherOutWarehouse._MakeUser")]
        [InverseProperty("MakeUser")]
        [NotMapped]
        [SoftFK(nameof(nERP.Model.Wms.OtherOutWarehouse.MakeUserId))]
        public List<OtherOutWarehouse> OtherOutWarehouse_MakeUser { get; set; }
        [Display(Name = "_Model._Receivable._MakeUser")]
        [InverseProperty("MakeUser")]
        [NotMapped]
        [SoftFK(nameof(nERP.Model.Fin.Receivable.MakeUserId))]
        public List<Receivable> Receivable_MakeUser { get; set; }
        [Display(Name = "_Model._Payment._MakeUser")]
        [InverseProperty("MakeUser")]
        [NotMapped]
        [SoftFK(nameof(nERP.Model.Fin.Payment.MakeUserId))]
        public List<Payment> Payment_MakeUser { get; set; }
        [Display(Name = "_Model._OtherIncome._MakeUser")]
        [InverseProperty("MakeUser")]
        [NotMapped]
        [SoftFK(nameof(nERP.Model.Fin.OtherIncome.MakeUserId))]
        public List<OtherIncome> OtherIncome_MakeUser { get; set; }
        [Display(Name = "_Model._OtherOutlay._MakeUser")]
        [InverseProperty("MakeUser")]
        [NotMapped]
        [SoftFK(nameof(nERP.Model.Fin.OtherOutlay.MakeUserId))]
        public List<OtherOutlay> OtherOutlay_MakeUser { get; set; }

	}

}
